<?php
/**
 * TeacherTitle Model
 *
 * Utilizes the Data Mapper pattern to persist data. Represents a single
 * teacher_title entry
 *
 * @version $Id: TeacherTitle.php 73 2010-04-25 00:30:44Z yingkuang.chen@gmail.com $
 * @license New BSD License
 * @uses Teacher_Model_TeacherTitleMapper
 * @package teacher
 * @subpackage Model
 */
class Teacher_Model_TeacherTitle extends Teacher_Model_Doctrine_BaseTeacherTitle
{

    public function  getTitleKind() {
        $locale = Bootstrap::$config['resources']['locale']['default'];
        $path = dirname(__FILE__)."/../languages/$locale/data.ini";
        $ini = new Zend_Config_Ini($path);
        $data = $ini->get('array_data')->toArray();
        return $data['current_kind_sn'];
    }


    public function getParentCount()
    {
        $res = $this->getTable()->createQuery('t')
        ->select('t.dicision_sn, COUNT(*) as cc')
        ->leftJoin('School_Model_SchoolRoom r')
        ->groupBy('t.division_sn')
        ->fetchArray();
        $res = $this->getAdapter()->query($select)->fetchAll();
        $arr = array();
        foreach($res as $row) {
            $arr[$row['division_sn']] = $row['cc'];
        }
        return $arr;
   }

    public function getMultiOptions()
    {
        $res = $this->getTable()->findAll();
        $arr = array();
        foreach ($res as $row)
        $arr[$row->sn] = $row->name_short;
        return $arr;
    }


    }
